cmake_minimum_required(VERSION 3.8)
project(mqtt_example)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  add_compile_options(-Wall -Wextra -Wpedantic)
endif()

# find dependencies
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)


find_package(PkgConfig REQUIRED)
pkg_check_modules(JSONCPP jsoncpp)
include_directories(${JSONCPP_LIBRARIES})
 
add_executable(mqtt_node src/mqtt_node.cpp) 
target_link_libraries(mqtt_node 
#rclcpp
${rclcpp_LIBRARIES}
${JSONCPP_LIBRARIES}
 mosquitto)
ament_target_dependencies(mqtt_node rclcpp)
 
install(TARGETS mqtt_node 
  DESTINATION lib/${PROJECT_NAME})

ament_package()
